using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerAnimations : MonoBehaviour
{ 
	
	private Animator anim;
	
	private readonly int moveX = Animator.StringToHash("MoveX"); 
	private readonly int moveY = Animator.StringToHash("MoveY"); 
	private readonly int moving= Animator.StringToHash("Moving");
	private readonly int dead = Animator.StringToHash("Dead");
	private readonly int revive = Animator.StringToHash("Revive");

	private void Awake()
	{
		anim = GetComponentInChildren<Animator>();
	}


	public void SetDeadAnimation()
	{
		anim.SetTrigger(dead);
	}

	public void SetMoveBoolTransition(bool isMoving)
	{
		anim.SetBool(moving, isMoving);
	}

	public void SetMoveAnimation(Vector2 dir)
	{
		anim.SetFloat(moveX, dir.x);
		anim.SetFloat(moveY, dir.y);
	}


	public void ResetPlayer()
	{
		SetMoveAnimation(Vector2.down);
		anim.SetTrigger(revive);
	}


}
